<?php

namespace app\adminbackstage\validate;

use think\Validate;

class StoreManage extends Validate
{
    protected $regex = [ 'password' => '^((?=.*?\d)(?=.*?[A-Za-z])|(?=.*?\d)(?=.*?[~!@#$%^&*()_+`\-={}:";\'<>,.\/?])|(?=.*?[A-Za-z])(?=.*?[~!@#$%^&*()_+`\-={}:";\'<>,.\/?]))[\dA-Za-z~!@#$%^&*()_+`\-={}:";\'<>,.\/?]+$'];

    protected $rule = [
        'phone' => 'require|mobile|number|length:11',
        'password' => 'require|length:6,20|regex:password',
        'nickname' => 'require',
        'username' => 'require',
    ];
    protected $message  =   [
        'phone.require' => '手机号码必须输入',
        'phone.mobile' => '手机号码必须填写',
        'phone.number'     => '手机号码只能是数字',
        'phone.length'     => '手机号码只能11位数字',
        'code.number'     => '验证码只能是数字',
        'code.length'     => '验证码只能4位数字',
        'password.require'   => '密码必须填写',
        'password.length'   => '密码长度必须是6-20个字符以内',
        'password.regex' => '密码必须是字母数字符号两种形式以上的组合',
        'nickname.require' => '请填写网点名称',
        'username.require' => '请填写登录用户名'
    ];
}